package com.jeff.controller;

import com.jeff.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangjf
 * @ClassName StorageController
 * @Description: TODO
 * @date 2021/8/19 18:21
 */
@RestController
@RequestMapping("storage")
public class StorageController {
    @Autowired
    private StorageService storageService;

    /**
     * 减库存
     *
     * @param commodityCode 商品代码
     * @param count         数量
     * @return
     */
    @GetMapping
    public String deduct(String commodityCode, Integer count) {
        storageService.deduct(commodityCode, count);
        return "success";
    }
}
